<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      box-sizing: border-box;
      padding: 0;
      margin: 0;
    }

    div {
      width: 500px;
      height: 400px;
      background-color: pink;
      /* div 你变成 flex */
      display: flex;
      /* 设置主轴方向 */
      /* flex-direction: row; */
      /* 主轴的子元素的对齐方式 */
      /* justify-content: flex-start;
      justify-content: flex-end;
      justify-content: space-between;
      justify-content: space-around;
      justify-content: space-evenly; */

      /* 侧轴的子元素的对齐方式  单行  */
      /* align-items: flex-start;
      align-items: flex-end;
      align-items: center; */

      /* flex 默认不会换行 */
      /* flex-wrap: wrap; */

      /* 侧轴的子元素的对齐方式  多行   */
      /* align-content: flex-start;
      align-content: flex-end;
      align-content: center;
      align-content: space-between;
      align-content: space-around;
      align-content: space-evenly; */

    }

    p {
      /* width: 100px; */
      height: 100px;
      background-color: yellow;
      border: 1px solid #000;
      flex: 1;

    }

    .box {
      background-color: green;
      /* 设置子元素自己 在侧轴上的对齐 */
      /* align-self: flex-end; */
      align-self: center;

      /* 设置宽度占父元素宽度剩下比例 layoutWeight */
      /* flex: 1; */
    }
  </style>
</head>

<body>
  <div>
    <p>1</p>
    <p>2</p>
    <p class="box">3</p>
    <p>4</p>
    <p>5</p>
  </div>

</body>

</html>